/*  Note This uses the old coding with Katy's Final Replciation Trimmed Dataset */

 use "C:\Users\ts139c\Dropbox\Trade Attitudes\Data and Code\Replication Files for FPA\PRS_replication_data_USuncoded_correctfactors_trimmed.dta"



gen mtrd2=w2trdegl2
gen mtrd3=w2trdegl3
gen mtrd4=w2trdegl4
gen mtrd5=w2trdegl5
gen mtrd6=w2trdegl6
gen mtrd9=w2trdegl9
gen mtrd10=w2trdegl10
gen mtrd11=w2trdegl11

recode mtrd2 (4=.)
recode mtrd3 (4=.)
recode mtrd4 (4=.)
recode mtrd5 (4=.)
recode mtrd6 (4=.)
recode mtrd9 (4=.)
recode mtrd10 (4=.)
recode mtrd11 (4=.)


gen rctrd2=w2trdegl2
gen rctrd3=w2trdegl3
gen rctrd4=w2trdegl4
gen rctrd5=w2trdegl5
gen rctrd6=w2trdegl6
gen rctrd9=w2trdegl9
gen rctrd10=w2trdegl10
gen rctrd11=w2trdegl11

recode rctrd2 (4=2)
recode rctrd3 (4=2)
recode rctrd4 (4=2)
recode rctrd5 (4=2)
recode rctrd6 (4=2)
recode rctrd9 (4=2)
recode rctrd10 (4=2)
recode rctrd11 (4=2)

drop if weight_w2==.

keep id weight_w2 mtrd2 mtrd3 mtrd4 mtrd5 mtrd6 mtrd9 mtrd10 mtrd11 ///
rctrd2 rctrd3 rctrd4 rctrd5 rctrd6 rctrd9 rctrd10 rctrd11

stata2mplus using nov20cfaus, missing (-999) 
